package com.wit.zhenghao.day13;

import java.io.IOException;
import java.io.InputStream;

import java.net.ServerSocket;
import java.net.Socket;

public class Server {
   public static void main(String[] args) {
	
	   try {
		ServerSocket server = new ServerSocket(6666);
		System.out.println("服务器启动了。。准备接收连接。。");
		Socket socket = server.accept();
		System.out.println("连接上了一个客户端："+socket.getInetAddress()+"端口："+socket.getPort());
		
		InputStream in = socket.getInputStream();
		System.out.println(in.read());
		
		System.out.println("通信结束。。");
	} catch (IOException e) {
		e.printStackTrace();
	}

}
}
